package com.aiyige.page.main.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.aiyige.page.discovery.DiscoveryPage;
import com.aiyige.page.home.HomePage;
import com.aiyige.page.learn.LearnPage;
import com.aiyige.page.my.MyPage;
import com.netease.nim.uikit.business.recent.RecentContactsFragment;
import com.aiyige.page.my.message.CommunicatePage;
import com.aiyige.page.my.message.adapter.CommunicateAdapter;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by zhuyakun on 2017/10/18.
 */

public class MainViewPagerAdapter extends FragmentStatePagerAdapter {
    List<Fragment> fragmentList = new LinkedList<>();

    public MainViewPagerAdapter(FragmentManager fm) {
        super(fm);
        fragmentList.add(HomePage.newInstance());
        //fragmentList.add(MessagePage.newInstance());
        //fragmentList.add(RecentContactsFragment.newInstance());
//        fragmentList.add(MessagePage.newInstance());
        //fragmentList.add(LearnPage.newInstance());
        fragmentList.add(DiscoveryPage.newInstance());
        fragmentList.add(CommunicatePage.newInstance());
        fragmentList.add(MyPage.newInstance());
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}
